package reviewpolymorphismup;

class Shape {
    public void draw() {
        System.out.println("画图形！");
    }
}

class Rect extends Shape {
    @Override
    public void draw() {
        System.out.println("画矩形！");
    }
}

class Cycle extends Shape {
    @Override
    public void draw() {
        System.out.println("画圆！");
    }
}

class Triangle extends Shape {
    @Override
    public void draw() {
        System.out.println("画一个三角形！");
    }
}
public class Test {
    //------------类的调用者书写的-----------------
    public static void drawMap(Shape shape) {
        shape.draw();
    }
    public static void main(String[] args) {
        Rect rect = new Rect();
        drawMap(rect);
        drawMap(new Cycle());
        drawMap(new Triangle());
    }

}
